package org.jeecg.modules.wlhy.hyvehicle.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.wlhy.hydriver.entity.HyDriver;
import org.jeecg.modules.wlhy.hyvehicle.entity.HyVehicle;
import org.jeecg.modules.wlhy.hyvehicle.entity.HyVehicleDTO;
import org.jeecg.modules.wlhy.hyvehicle.entity.HyVehicleType;

import java.util.List;

/**
 * @Description: 车辆管理
 * @Author: duanlikao
 * @Date:   2020-12-05
 * @Version: V1.0
 */
public interface HyVehicleMapper extends BaseMapper<HyVehicle> {

    int  deleteVehicleById(@Param("id")  String id);

    HyVehicle getHyVehicleByVehicleNumber(@Param("vehicleNumber") String vehicleNumber);

    List<HyVehicleType> getHyVehicleTypeById(@Param("pid")  String pid);

    List<HyVehicle> getVehicleByDriverId(@Param("driverId")  String driverId);

    HyVehicle getHyVehicleByVehicleNumberAndDriverId(@Param("vehicleNumber") String vehicleNumber,
                                                     @Param("driverId")  String driverId);

    HyVehicleType getHyVehicleTypeByText(@Param("text") String text);


    List<HyVehicle> pageList(Page<HyVehicle> page,@Param(Constants.WRAPPER) QueryWrapper<HyVehicle> queryWrapper,@Param("customerId") String customerId);

    int getDsvehicleCount(@Param("customerId")  String customerById);

    List<HyDriver> getDriversByVehicleId(String vehicleId);

    List<HyVehicle> getVehicleListByCarrierId(@Param("carrierId") String carrierId);

    List<HyVehicle> pageList1(Page<HyVehicle> page, @Param(Constants.WRAPPER)QueryWrapper<HyVehicleDTO> queryWrapper, String customerId);
}
